package com.clear.subject.common.enums;

import lombok.Getter;

/**
 * 题目游标枚举
 */
@Getter
public enum SubjectCursorEnum {
    NEXT_CURSOR(1, "下一题"),
    LAST_CURSOR(0, "上一题");

    private int code;
    private String desc;

    SubjectCursorEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SubjectCursorEnum getByCode(int codeVal) {
        for (SubjectCursorEnum resultCodeEnum : SubjectCursorEnum.values()) {
            if (resultCodeEnum.code == codeVal) {
                return resultCodeEnum;
            }
        }
        return null;
    }

}
